<?php namespace App\Http\Controllers\Admin;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\Recharge;
use Illuminate\Http\Request;

class HisController extends Controller
{
//显示内容
    public function getRecharge(Request $request)
    {
        $list = Recharge::orderBy('updatetime','DESC');
        $appends = $request->all();
        if(isset($appends['subject']) && "" != $appends['subject']){
            $list = $list->where('subject','like', '%' . $appends['subject'] . '%');
        }
        if(isset($appends['channel']) && "" != $appends['channel']){
            $list = $list->where('channel',$appends['channel']);
        }
        if(isset($appends['state']) && "" != $appends['state']){
            $list = $list->where('state',$appends['state']);
        }
        $list = $list->paginate(config('site.admin.pageSize'));
        return view('admin.his.recharge',[
            'list' => $list,
            'appends' => $appends,
            'channel' => ['1' => '支付宝','2' => '微信'],
            'state' => ['1'=>'处理中', '2'=>'充值成功', '3'=>'充值失败'],
        ]);
    }
}
